import config as cg

def readLinksRevPages():
	with open(cg.history_links) as f:
		content = f.readlines()
	
	return content
	

def getXY():
	content = open(cg.size,'r').read()
		
	rows = content.split('\n');
	x = []
	y = []
	for row in rows:
		columns = row.split(' ');
		if( len(columns) == 3 ):
			#print columns;
			x.append(float(columns[0]));
			y.append(float(columns[2]));
	return x,y;

#Reading the pageValues for different metrics
def getXYZ():
	content = open(cg.pageValues,'r').read()
		
	rows = content.split('\n');
	x = []
	y = []
	z = []
	a = []
	b = []
	c = []
	n = []
	i = 0
	for row in rows:
		columns = row.split(' ');
		if( len(columns) == 7 ):
			#print columns;
			x.append(float(columns[1]));
			y.append(float(columns[2]));
			z.append(float(columns[3]));
			a.append(float(columns[4]));
			b.append(float(columns[5]));
			c.append(float(columns[6]));

			n.append(i);
			i += 1
	return x,y,z,a,b,c,n;
	
	
def getRev():
	content = open(cg.size,'r').read()
		
	rows = content.split('\n');
	x = []
	y = []
	for row in rows:
		columns = row.split(' ');
		if( len(columns) == 3 ):
			x.append(columns[1]);
	return x;


def getRev1():
	content = open(cg.size1,'r').read()
		
	rows = content.split('\n');
	x = []
	y = []
	z = []
	for row in rows:
		columns = row.split(' ');
		if( len(columns) == 3 ):
			x.append(columns[1]);
	return x;		


